package com.zhonghan.recharge.dao;
import com.zhonghan.recharge.pojo.ZhCardReceive;
import java.util.List;

import org.apache.ibatis.annotations.Param;
public interface ZhCardReceiveDao{
	/**
	 * 获得ZhCardReceive数据的总行数
	 * @return
	 */
    long getZhCardReceiveRowCount();
	/**
	 * 获得ZhCardReceive数据集合
	 * @return
	 */
    List<ZhCardReceive> selectZhCardReceive();
	/**
	 * 获得一个ZhCardReceive对象,以参数ZhCardReceive对象中不为空的属性作为条件进行查询
	 * @param obj
	 * @return
	 */
    ZhCardReceive selectZhCardReceiveByObj(ZhCardReceive obj);
	/**
	 * 通过ZhCardReceive的id获得ZhCardReceive对象
	 * @param id
	 * @return
	 */
    ZhCardReceive selectZhCardReceiveById(Integer id);
	/**
	 * 插入ZhCardReceive到数据库,包括null值
	 * @param value
	 * @return
	 */
    int insertZhCardReceive(ZhCardReceive value);
	/**
	 * 插入ZhCardReceive中属性值不为null的数据到数据库
	 * @param value
	 * @return
	 */
    int insertNonEmptyZhCardReceive(ZhCardReceive value);
	/**
	 * 批量插入ZhCardReceive到数据库,包括null值
	 * @param value
	 * @return
	 */
    int insertZhCardReceiveByBatch(List<ZhCardReceive> value);
	/**
	 * 通过ZhCardReceive的id删除ZhCardReceive
	 * @param id
	 * @return
	 */
    int deleteZhCardReceiveById(Integer id);
	/**
	 * 通过ZhCardReceive的id更新ZhCardReceive中的数据,包括null值
	 * @param enti
	 * @return
	 */
    int updateZhCardReceiveById(ZhCardReceive enti);
	/**
	 * 通过ZhCardReceive的id更新ZhCardReceive中属性不为null的数据
	 * @param enti
	 * @return
	 */
    int updateNonEmptyZhCardReceiveById(ZhCardReceive enti);
    /**
     * 查看领取人
     * @param sequence充值卡卡号
     * @return
     */
    ZhCardReceive selectZhCardReceiveBySequence(String sequence);
    
    /**
     * 通过充值卡号查询，领取人信息 
     * @param sequence
     * @return
     */
    ZhCardReceive selectZhCardReceiveBySequenceII(String sequence);
    /**
     * 查询领卡人
     * @param receive
     * @return
     */
    List<ZhCardReceive> selectZhCardReceiveByName(ZhCardReceive receive);
    /**
     * 修改领取状态
     * @param sequenceBegin
     * @param sequenceEnd
     * @return
     */
    int updateZhCardReceiveByStatus(@Param("sequenceBegin")String sequenceBegin,@Param("sequenceEnd")String sequenceEnd);
    /**
     * 修改端口
     * @param id
     * @param portToken
     * @param portAppkey
     * @param portAppsecret
     * @param portUrl
     * @param portPhone
     * @return
     */
    int updateZhCardReceiveByPort(@Param("id")Long id,@Param("portToken")String portToken,@Param("portAppkey")String portAppkey,
    		@Param("portAppsecret")String portAppsecret,@Param("portUrl")String portUrl,@Param("portPhone")String portPhone);
    
    /**
     * 判断领卡区间是否存在
     * @param sequenceBegin
     * @param sequenceEnd
     * @return
     */
	List<ZhCardReceive> selectZhCardReceiveExist(@Param("sequenceBegin") String sequenceBegin,@Param("sequenceEnd") String sequenceEnd);
    
}